<!--
 * @Author: asushiye
 * @Date: 2020-07-02 15:30:23
 * @Commit: file content
-->
<page-header autoTitle="false" />

<nz-card>
  <form nz-form nzLayout="inline" se-container>
    <!-- <se label="类型枚举" labelWidth="0"> -->
    <nz-select id="databaseType" [(ngModel)]="queryParams.databaseType" [ngModelOptions]="{ standalone: true }">
      <nz-option nzLabel="all" nzValue="" />
      <nz-option *ngFor="let item of databaseTypes" [nzLabel]="item" [nzValue]="item" />
    </nz-select>
    <!-- </se> -->

    <se label="数据类型" labelWidth="0">
      <input nz-input name="dataType" placeholder="支持模糊查询" [(ngModel)]="queryParams.dataType" />
    </se>
    <se>
      <button nz-button nzType="primary" (click)="query()" [nzLoading]="isLoading">查询</button>
      <button nz-button nzType="default" (click)="importData()" [nzLoading]="isLoading">
        <span>导入</span>
        <i nz-icon nzType="import"></i>
      </button>
      <button nz-button nzType="default" (click)="exportData()" [nzLoading]="isExporting">
        <span>导出</span>
        <i nz-icon nzType="export"></i>
      </button>
      <button nz-button [nzType]="'default'" (click)="downloadTemplate()">
        <span>下载模板</span>
        <i nz-icon nzType="download"></i>
      </button>

      <button nz-button nz-dropdown [nzDropdownMenu]="menu" [nzLoading]="isLogExporting">
        历史日志
        <i nz-icon nzType="down"></i>
      </button>
      <nz-dropdown-menu #menu="nzDropdownMenu">
        <ul nz-menu>
          <li nz-menu-item>
            <a (click)="exportLog()"> 下载当前日志 </a>
          </li>
          <li nz-menu-item>
            <a (click)="navUploadLogView()">历史上传记录 </a>
          </li>
        </ul>
      </nz-dropdown-menu>
    </se>
  </form>
  <st #st [data]="rows" [columns]="columns" [expand]="expand" [ps]="20" size="small" expandRowByClick expandAccordion>
    <ng-template #expand let-item let-index="index" let-column="column">
      <sv-container size="small" col="2">
        <sv-title>更多内容</sv-title>
        <sv label="使用说明" type="success">{{ item!.useGuide }}</sv>
        <sv label="详细描述" type="success">{{ item!.remarkInfo }}</sv>
        <sv label="创建人">{{ item!.createdBy }}</sv>
        <sv label="创建时间">{{ item!.createdDate }}</sv>
      </sv-container>
    </ng-template>
  </st>
</nz-card>
